package xyz.hubery.util;

import xyz.hubery.domain.EntrustOrder;
import xyz.hubery.domain.Order;

public class BeanUtil {

    public static Order entrustOrderToOrder(EntrustOrder entrustOrder) {
        Order order = new Order();
        order.setOrderId(String.valueOf(entrustOrder.getId()));
        order.setUserId(entrustOrder.getUserId());
        order.setSymbol(entrustOrder.getSymbol());
        order.setVolume(entrustOrder.getVolume());
        order.setTradedVolume(entrustOrder.getDeal());
//        order.setTurnover(entrustOrder.get);
//        order.setCoinSymbol();
//        order.setBaseSymbol();
        order.setOrderStatus(entrustOrder.getStatus());
        order.setOrderDirection(entrustOrder.getType());
        order.setPrice(entrustOrder.getPrice());
        order.setTime(entrustOrder.getCreated().getTime());
//        order.setCompletedTime();
//        order.setCancelTime();
//        order.setDetails();

        return order;
    }
}
